import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '@/views/index.vue'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Index',
    redirect: '/home',
    component: Index,
    children: [{
      path: 'home',
      component: () => import('@/views/home.vue')
    }, {
      path: 'recognize',
      redirect: '/recognize/cardItem',
      component: () => import('@/views/virus/virus.vue'),
      children: [{
        path: "cardItem",
        component: () => import('@/views/virus/cardItem.vue'),

      },]
    }, {
      path: "story",
      component: () => import('@/views/story.vue')
    },
    {
      path: "exam",
      redirect: '/exam/examination',
      component: () => import('@/views/competition/index.vue'),
      children: [
        {
          path: 'detail',
          component: () => import('@/views/competition/detail.vue')
        },
        {
          path: 'examination',
          component: () => import('@/views/competition/examination.vue')
        }

      ],
    }, {
      path: "edit",
      component: () => import('@/views/edit.vue')
    }, {
      path: "news",
      component: () => import('@/views/News.vue')
    }, {
      path: "info",
      redirect: '/info/userInfo',
      component: () => import('@/views/info/index.vue'),
      children: [
        {
          path: 'userInfo',
          component: () => import('@/views/info/info.vue')
        },
        {
          path: 'editInfo',
          component: () => import('@/views/info/editInfo.vue')
        }

      ],

    }, {
      name: "ReConD",
      path: "detail",
      component: () => import('@/views/detail.vue'),

    },
    {
      path: 'lecture',
      component: () => import('@/views/lecture/index.vue')
    },
    
    ]
  },
  {
    path: '/user',
    component: () => import('@/views/user/index.vue'),
    children: [
      {
        path: 'login',
        component: () => import('@/views/user/login.vue'),
      },
      {
        path: 'register',
        component: () => import('@/views/user/register.vue'),
      }
    ]
  },
  {
    path: '/playVideo',
    component: () => import('@/views/lecture/video.vue')
  }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
